home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9206.ARJ / 1006071A < prev    next >
Text File  |  1992-06-02  |  2KB  |  49 lines

  1.  
  2.  package SYM_UTIL is
  3.                                -- Global debug switch.
  4.      SYM_UTIL_DEBUG: BOOLEAN := FALSE ;
  5.                                -- Add symbol to table.
  6.      procedure SYM_ADD (NAME: STRING, VALUE: INTEGER)
  7.                                -- Delete symbol from table.
  8.      procedure SYM_DELETE (NAME: STRING) ;
  9.                                -- Lookup a symbol.
  10.      function SYM_LOOKUP (NAME: STRING) return INTEGER ;
  11.  end SYM_UTIL ;
  12.  
  13.  package body SYM_UTIL is
  14.                                -- Internal variables.
  15.      type SYMBOL_NODE is record
  16.          ...
  17.      end record ;
  18.      SYMBOL_LIST: access SYMBOL_NODE := null ;
  19.                                -- Public functions.
  20.      procedure SYM_ADD (NAME: STRING, VALUE: INTEGER) is
  21.      begin
  22.          ... adds NAME/VALUE pair to the symbol table ...
  23.      end SYM_ADD ;
  24.  
  25.      procedure SYM_DELETE (NAME: STRING) is
  26.      begin
  27.          ... deletes NAME from the symbol table ...
  28.      end SYM_DELETE ;
  29.  
  30.      function SYM_LOOKUP (NAME: STRING) return INTEGER is
  31.      begin
  32.          ... returns NAME's value from the symbol table ...
  33.      end SYM_LOOKUP ;
  34.                                -- Internal function called
  35.                                -- by the other functions.
  36.      function SYM_LOCATE (NAME: STRING)
  37.          return access SYMBOL_NODE is
  38.      begin
  39.          ... locates NAME's node in the symbol list ...
  40.      end SYM_LOCATE ;
  41.  
  42.  end SYM_UTIL ;
  43.  
  44.  
  45.              Listing 1: Ada Symbol Table Package
  46.              -----------------------------------
  47.  
  48.  
  49.